package day3;

import day2.pet.Dog;

import java.util.Comparator;

/**
 * @author oldliu
 * @since 1.0
 */
public class HealthAndLoveCom implements Comparator<Dog> {
    @Override
    public int compare(Dog o1, Dog o2) {
        //return o1.getHealth()+o1.getLove()-(o2.getHealth()+o2.getLove());
        return -(o1.getHealth()+o1.getLove())+(o2.getHealth()+o2.getLove());
    }
}
